home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Input / IFOParser / IFOParser.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-11  |  3.3 KB  |  134 lines

  1. /* 
  2.  *  IFOParser.h 
  3.  *
  4.  *    Copyright (C) Alberto Vigata - January 2000  ultraflask@yahoo.com
  5.  *                 
  6.  *
  7.  *  This file is part of FlasKMPEG, a free MPEG to MPEG/AVI converter
  8.  *    
  9.  *  FlasKMPEG is free software; you can redistribute it and/or modify
  10.  *  it under the terms of the GNU General Public License as published by
  11.  *  the Free Software Foundation; either version 2, or (at your option)
  12.  *  any later version.
  13.  *   
  14.  *  FlasKMPEG is distributed in the hope that it will be useful,
  15.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.  *  GNU General Public License for more details.
  18.  *   
  19.  *  You should have received a copy of the GNU General Public License
  20.  *  along with GNU Make; see the file COPYING.  If not, write to
  21.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  22.  *
  23.  */
  24.  
  25. #if !defined(AFX_IFOPARSER_H__0B7FA440_0FEC_11D4_93EA_00000100CF13__INCLUDED_)
  26. #define AFX_IFOPARSER_H__0B7FA440_0FEC_11D4_93EA_00000100CF13__INCLUDED_
  27.  
  28. #if _MSC_VER > 1000
  29. #pragma once
  30. #endif // _MSC_VER > 1000
  31.  
  32. #include "ifo.h"
  33.  
  34. #include "..\..\Misc\CArray.h"
  35.  
  36. struct TSpan
  37. {
  38.     __int64  start;
  39.     __int64  end;
  40. };
  41.  
  42. class TCellAdressInfo
  43. {
  44. public:
  45.     int             vobid;
  46.     int            cellid;
  47.     CArr<TSpan>       pos;
  48.     TCellAdressInfo& operator =(TCellAdressInfo& right);
  49. };
  50.  
  51.  
  52.  
  53. struct TCellPlayInfo
  54. {
  55.     int        parsed;
  56.     int        vobid;
  57.     int        cellid;
  58.     __int64    start;
  59.     __int64    end;
  60. };
  61.  
  62. class TPGC
  63. {
  64.     public: 
  65.     unsigned char        clut[16][4];
  66.     CArr<TCellPlayInfo>  chain_cells;
  67.     unsigned int          chain_time;
  68.     TPGC& operator =(TPGC& right);
  69. };
  70.  
  71. // This class stores a PGC angle and its
  72. // playing info as a series of spans
  73. class CBuiltPGC
  74. {
  75.     public: 
  76.     int           chain_time;
  77.     CArr<TSpan>   playinfo;
  78. };
  79.  
  80. // This class stores a PGC chain with its
  81. // angled variants
  82. class CBuiltAPGC
  83. {
  84.     public: 
  85.     CArr<CBuiltPGC>   BuiltPGC;
  86. };
  87.  
  88. enum {IFO_AC3=0, IFO_MPEGAUDIO};
  89.  
  90. class CIFOParser  
  91. {
  92. public:
  93. //    int           SetInputStream(CinputStream *input);
  94.     char         *GetSubpicID(int id);
  95.     unsigned int  GetPGCTime(TPGC *pgc);
  96.     TPGC         *GetPGC(int id);
  97.     int           GetPGCCount();
  98.     int           GetSubpicCLUT( TPGC *pgc , char *clut);
  99.     int           GetSubpicCount();
  100.     char         *GetAudioID(int id);
  101.     int           GetAudioCount();
  102.     int           Load( char *file );
  103.     int           UnLoad();
  104.              CIFOParser();
  105.     virtual ~CIFOParser();
  106.         
  107.     //Should be private
  108.     int    AudioCount;
  109.     int    SubpicCount;
  110.     char   AudioID[8][256];
  111.     int    AudioMode[8];
  112.     char   SubpidID[32][256];
  113.     
  114.     int    PGCptr; //this pointer is used to know what pgc we're working on
  115.                     // while parsing the data
  116.     int    fatal_error_flag;  // flag indicating fatal error
  117.     // PGCs info
  118.     CArr<TPGC>                      pgcs;
  119.     CArr<TCellAdressInfo>   cell_address;
  120.  
  121.     // Thiss member stores the whole PGCs playing
  122.     // info inside the IFO file
  123.     CArr<CBuiltAPGC>  PGCs;
  124.  
  125.     ifo_t *ifo;
  126.     int   fd;
  127. private:
  128.     int RenderCell(int pgc_number, int angle, int cell_to_render);
  129.     int GetCellSpans(CArr<TSpan>& cell_spans, int vobid, int cellid);
  130.  
  131. };
  132.  
  133. #endif // !defined(AFX_IFOPARSER_H__0B7FA440_0FEC_11D4_93EA_00000100CF13__INCLUDED_)
  134.